import Vue from "vue";
import VueRouter from "vue-router";
import homeRouter from "@/views/home/router.js";

Vue.use(VueRouter);

const routes = [
  {
    path: "/index",
    name: "Index",
    component: () => import("@/views/Index.vue"),
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("@/views/home/Home.vue"),
      },
    ],
  },
  ...homeRouter,
  {
    path: "/swiper",
    name: "swiper",
    component: () => import("@/views/Swiper.vue"),
  },
  {
    path: "/demo",
    name: "demo",
    component: () => import("@/views/Demo.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
